package com.supermarket.manage.common.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 盘点商品实体类
 *
 * @author: Faxon
 * @data: 2020/3/17
 */
@ApiModel(value = "StockingProd：盘点商品实体类")
@Data
@TableName("tb_stocking_prod")
public class StockingProd implements Serializable {

    private static final long serialVersionUID = 754065686201744139L;
    /**
     * 主键id
     */
    @ApiModelProperty(value = "主键id")
    @TableId(type = IdType.ASSIGN_UUID)
    private String sid;

    /**
     * 盘点单id
     */
    @ApiModelProperty(value = "盘点单id")
    private String stockingId;

    /**
     * 商品id
     */
    @ApiModelProperty(value = "商品id")
    @NotBlank(message = "商品id不能为空")
    private String pid;

    /**
     * 原商品数量
     */
    @ApiModelProperty(value = "原商品数量")
    @NotNull(message = "原商品数量不能为空")
    private BigDecimal pnumber;

    /**
     * 盘点数量
     */
    @ApiModelProperty(value = "盘点数量")
    @NotNull(message = "盘点数量不能为空")
    private BigDecimal snumber;

    /**
     * 小计
     */
    @ApiModelProperty(value = "小计 = 商品成本价*（盘点数量-原商品数量）")
    @NotNull(message = "小计不能为空")
    private BigDecimal subtotal;
}
